/*
 * XML Type:  ResourceCollectionType
 * Namespace: http://www.data-archive.ac.uk/dext/schema/draft
 * Java type: uk.da.dext.ResourceCollectionType
 *
 * Automatically generated - do not modify.
 */
package uk.da.dext.impl;
/**
 * An XML ResourceCollectionType(@http://www.data-archive.ac.uk/dext/schema/draft).
 *
 * This is a complex type.
 */
public class ResourceCollectionTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements uk.da.dext.ResourceCollectionType
{
    private static final long serialVersionUID = 1L;
    
    public ResourceCollectionTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SOURCES$0 = 
        new javax.xml.namespace.QName("http://www.data-archive.ac.uk/dext/schema/draft", "sources");
    private static final javax.xml.namespace.QName MEMOSOURCES$2 = 
        new javax.xml.namespace.QName("http://www.data-archive.ac.uk/dext/schema/draft", "memoSources");
    private static final javax.xml.namespace.QName DOCUMENTS$4 = 
        new javax.xml.namespace.QName("http://www.data-archive.ac.uk/dext/schema/draft", "documents");
    private static final javax.xml.namespace.QName ID$6 = 
        new javax.xml.namespace.QName("", "id");
    
    
    /**
     * Gets the "sources" element
     */
    public uk.da.dext.SourcesType getSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.SourcesType target = null;
            target = (uk.da.dext.SourcesType)get_store().find_element_user(SOURCES$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "sources" element
     */
    public boolean isSetSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SOURCES$0) != 0;
        }
    }
    
    /**
     * Sets the "sources" element
     */
    public void setSources(uk.da.dext.SourcesType sources)
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.SourcesType target = null;
            target = (uk.da.dext.SourcesType)get_store().find_element_user(SOURCES$0, 0);
            if (target == null)
            {
                target = (uk.da.dext.SourcesType)get_store().add_element_user(SOURCES$0);
            }
            target.set(sources);
        }
    }
    
    /**
     * Appends and returns a new empty "sources" element
     */
    public uk.da.dext.SourcesType addNewSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.SourcesType target = null;
            target = (uk.da.dext.SourcesType)get_store().add_element_user(SOURCES$0);
            return target;
        }
    }
    
    /**
     * Unsets the "sources" element
     */
    public void unsetSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SOURCES$0, 0);
        }
    }
    
    /**
     * Gets the "memoSources" element
     */
    public uk.da.dext.MemoSourcesType getMemoSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.MemoSourcesType target = null;
            target = (uk.da.dext.MemoSourcesType)get_store().find_element_user(MEMOSOURCES$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "memoSources" element
     */
    public boolean isSetMemoSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MEMOSOURCES$2) != 0;
        }
    }
    
    /**
     * Sets the "memoSources" element
     */
    public void setMemoSources(uk.da.dext.MemoSourcesType memoSources)
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.MemoSourcesType target = null;
            target = (uk.da.dext.MemoSourcesType)get_store().find_element_user(MEMOSOURCES$2, 0);
            if (target == null)
            {
                target = (uk.da.dext.MemoSourcesType)get_store().add_element_user(MEMOSOURCES$2);
            }
            target.set(memoSources);
        }
    }
    
    /**
     * Appends and returns a new empty "memoSources" element
     */
    public uk.da.dext.MemoSourcesType addNewMemoSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.MemoSourcesType target = null;
            target = (uk.da.dext.MemoSourcesType)get_store().add_element_user(MEMOSOURCES$2);
            return target;
        }
    }
    
    /**
     * Unsets the "memoSources" element
     */
    public void unsetMemoSources()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MEMOSOURCES$2, 0);
        }
    }
    
    /**
     * Gets the "documents" element
     */
    public uk.da.dext.DocumentsType getDocuments()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.DocumentsType target = null;
            target = (uk.da.dext.DocumentsType)get_store().find_element_user(DOCUMENTS$4, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "documents" element
     */
    public boolean isSetDocuments()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DOCUMENTS$4) != 0;
        }
    }
    
    /**
     * Sets the "documents" element
     */
    public void setDocuments(uk.da.dext.DocumentsType documents)
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.DocumentsType target = null;
            target = (uk.da.dext.DocumentsType)get_store().find_element_user(DOCUMENTS$4, 0);
            if (target == null)
            {
                target = (uk.da.dext.DocumentsType)get_store().add_element_user(DOCUMENTS$4);
            }
            target.set(documents);
        }
    }
    
    /**
     * Appends and returns a new empty "documents" element
     */
    public uk.da.dext.DocumentsType addNewDocuments()
    {
        synchronized (monitor())
        {
            check_orphaned();
            uk.da.dext.DocumentsType target = null;
            target = (uk.da.dext.DocumentsType)get_store().add_element_user(DOCUMENTS$4);
            return target;
        }
    }
    
    /**
     * Unsets the "documents" element
     */
    public void unsetDocuments()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DOCUMENTS$4, 0);
        }
    }
    
    /**
     * Gets the "id" attribute
     */
    public java.lang.String getId()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$6);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "id" attribute
     */
    public org.apache.xmlbeans.XmlID xgetId()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlID target = null;
            target = (org.apache.xmlbeans.XmlID)get_store().find_attribute_user(ID$6);
            return target;
        }
    }
    
    /**
     * Sets the "id" attribute
     */
    public void setId(java.lang.String id)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ID$6);
            }
            target.setStringValue(id);
        }
    }
    
    /**
     * Sets (as xml) the "id" attribute
     */
    public void xsetId(org.apache.xmlbeans.XmlID id)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlID target = null;
            target = (org.apache.xmlbeans.XmlID)get_store().find_attribute_user(ID$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlID)get_store().add_attribute_user(ID$6);
            }
            target.set(id);
        }
    }
}
